﻿<sdk:ChildWindow x:Class="Apps.Yunwei.Views.ColorSelector"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
                 xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
                 Style="{StaticResource MetroChildWindow}"
                 Title="选择颜色" Width="640" Height="400">
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="5"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <ListBox x:Name="list" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="52" />
                            <RowDefinition Height="20" />
                        </Grid.RowDefinitions>
                        <Rectangle Width="52" Height="52" Fill="{Binding}" Stroke="#49000000"/>
                        <TextBlock Text="{Binding}" Grid.Row="1" FontSize="8"/>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <toolkit:WrapPanel Width="590" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>
        <Button x:Name="OKButton" Content="确定"
                Click="OKButton_Click" Width="75" Height="23" Margin="0,0,79,0"
                HorizontalAlignment="Right" Grid.Row="2"/>
        <Button x:Name="CancelButton" Content="取消" 
                Click="CancelButton_Click" Width="75" Height="23"
                HorizontalAlignment="Right" Grid.Row="2"/>
    </Grid>
</sdk:ChildWindow>